<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyPetStore</title>
    <link rel="icon" href="../images/title.png" sizes="32x32">
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css"
          media="screen"/>
    <link rel="StyleSheet" href="../css/searchProduct.css" type="text/css" media="screen"/>
    <link rel="stylesheet" href="../css/mouseEventInform.css" type="text/css" media="screen"/>
</head>
<body>
<div th:replace="common/IncludeTop">
</div>

<div id="Content">
    <div id="BackLink"  >
        <a th:href="@{'viewCategory?categoryId=' + ${product.getCategoryId()}}"
           th:text="'Return to ' + ${product.getCategoryId()}">
        </a>
    </div>

    <div id="Catalog"  >
        <h2 th:text="${product.name}">product的name属性</h2>

        <table>
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th>&nbsp;</th>
            </tr>

            <tr th:each="item:${itemList}">
                <td>
                    <a th:href="@{'viewItem?itemId=' + ${item.getItemId()}}" th:text="${item.getItemId()}"></a>
                </td>
                <td th:text="${item.getProduct().getProductId()}"></td>
                <td>
                    <span th:if="${item.getAttribute1()} != null" th:text="${item.getAttribute1()}"></span>
                    <span th:if="${item.getAttribute2()} != null" th:text="${item.getAttribute2()}"></span>
                    <span th:if="${item.getAttribute3()} != null" th:text="${item.getAttribute3()}"></span>
                    <span th:if="${item.getAttribute4()} != null" th:text="${item.getAttribute4()}"></span>
                    <span th:if="${item.getAttribute5()} != null" th:text="${item.getAttribute5()}"></span>
                    <span th:if="${product.getName()} != null" th:text="${product.getName()}"></span>
                </td>
                <td th:text="'$' + ${#numbers.formatDecimal(item.listPrice, 1, 2)}"></td>
                <td>
                    <a th:href="@{'addItemToCart?workingItemId=' + ${item.getItemId()}}" class="Button" th:text="'Add to Cart'"></a>
                </td>
            </tr>
        </table>
    </div>
</div>
</div>

<div th:replace="common/IncludeBottom">
</div>
</body>
</html>